import request from '@/utils/request'

/// 查询标签列表
export const getArticleslistApi = (params) => {
  return request({
    url: '/articles',
    method: 'get',
    params
  })
}
/// 文章删除
export const delArticlesApi = (id) => {
  return request({
    url: '/articles/' + id ,
    method: 'DELETE',
  })
}
/// 文章编辑
export const edlArticlesApi = (data) => {
  return request({
    url: '/articles/' + data.id ,
    method: 'PUT',
    data
  })
}
/// 文章详情
export const getArticlesInfoApi = (id) => {
  return request({
    url: '/articles/' + id ,
    method: 'GET',
  })
}
/// 文章添加
export const addArticlesApi = (data) => {
  return request({
    url: '/articles',
    method: 'POST',
    data
  })
}
/// 文章状态
export const getStateApi = (id, state) => {
  return request({
    // url: '/articles/' + id + state,
    url: `/articles/${id}/${state}`,
    method: 'POST',
  })
}